<template>
  <!-- 商品发布页 -->
  <div>
    <addAndEditVue ref="addAndEditVue" @success="back" @close="back"></addAndEditVue>
  </div>
</template>

<script>
import addAndEditVue from './addAndEdit.vue';
export default {
  name: "GoodsReleasePage",
  components:{addAndEditVue},
  data() {
    return {
      
    };
  },
  mounted(){
    this.$nextTick(()=>{
      this.openAdd()
    })
  },
  activated(){
    this.$nextTick(()=>{
      this.openAdd()
    })
  },
  methods: {
    openAdd(){
      this.$refs.addAndEditVue.open("add");
    },
    back(e){
      if(e){
        this.goLinkName(e)
      }else{
        history.go(-1)
      }
    },
    // 跳转页面  用组件名
    goLinkName(name,permiStr) {
      if(permiStr&&!this.checkPermi([permiStr])){
        return this.$message.error('你还没有该模块权限，请联系管理员分配权限！')
      }
      this.$router.push({
        name: name,
      });
    },
  }
};
</script>
<style scoped lang="scss">

</style>
